<template lang="pug">
view.bg
	view.cart.p10
		view.title.flex.at
			image(
				:src="form.src",
				mode="widthFix",
				style="width:16px;margin-right:6px"
			) {{form.name}}
		view.box.prl10
			view.palist(v-for="item,index in list")
				view.flex(v-if="item.type=='text'")
					view.f14.c3 {{item.name}}
					view.ml.f14.c6 {{item.value}}
				view.flex.at(v-if="item.type=='arrow'",@click="go")
					view.f14.c3 {{item.name}}
					view.ml
						<u-icon name="arrow-right" color="#666" size="14"></u-icon>
				view(v-if="item.type=='img'")
					view.f14.c3 {{item.name}}
					view
						image(
							v-for="ite,inx in item.value.split(',')"
							:src="ite",
							mode="widthFix",
							style="width:80px;margin-right:6px;margin-bottom:6px"
						)
</template>

<script>
	export default {
		data() {
			return {
				type:0,
				form:{},
				list:[]
			}
		},
		onLoad(e) {
			this.type=e.type
			this.form.name=e.name
			this.form.src='/static/g/'+e.type+'.png'
			console.log(this.form.src)
			if(e.type){
				let arr=[
					{
					type:'text',
					name:'孕周',
					value:'VVVV'
					},
					{
					type:'text',
					name:'空腹血糖值',
					value:'VVVV mmol/l'
					},
					{
					type:'arrow',
					name:'餐后血糖值',
					value:'VVVV mmol/l'
					},
					{
					type:'text',
					name:'餐后血糖值',
					value:'VVVV mmol/l'
					},
					{
					type:'img',
					name:'上传化验单',
					value:'http://img.duoziwang.com/2018/06/2018010130169489.jpg,http://img.duoziwang.com/2018/06/2018010130169489.jpg'
					},
				]
				this.list=arr
			}
			return uni.setNavigationBarTitle({
				title:e.name
			})
			
			console.log(this.list)
			// switch(e){
			// 	case e:
				
			// }
		},
		methods: {
			go(){
				uni.navigateTo({
					url:'/pages/jilu/jilu'
				})
			},
		}
	}
</script>

<style>
page{
	background: #f0f0f0;
}
.palist{
	width: 100%;
	border-bottom: #eee solid 1px;
	line-height: 46px;
}
</style>
